﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WPFDevelopers.Samples.Models
{
    public class PublicParam : ViewModelBase
    {
        /// <summary>
        /// 定义一个带参数 无返回值的委托
        /// </summary>
        /// <param name="param"></param>
        public delegate void DataSourceEventHandler(PublicParam param);
        /// <summary>
        /// 定义一个委托类型的事件
        /// </summary>
        public event DataSourceEventHandler LoadDataEventHandler;

        protected virtual void OnLoadDataEventHandler()
        {
            if (LoadDataEventHandler != null)
            {
                LoadDataEventHandler(this);
            }
        }

        public PublicParam()
        {

        }


        /// <summary>
        /// 
        /// </summary>
        private int _PageSize;
        public int PageSize
        {
            get => _PageSize;
            set
            {
                SetProperty(ref _PageSize, value);
                OnLoadDataEventHandler();
            }
        }


        /// <summary>
        /// 
        /// </summary>
        private int _PageIndex;
        public int PageIndex
        {
            get => _PageIndex;
            set
            {
                SetProperty(ref _PageIndex, value);
                OnLoadDataEventHandler();
            }

        }



        /// <summary>
        /// 
        /// </summary>
        private int _SumCount;
        public int SumCount
        {
            get => _SumCount;
            set
            {
                SetProperty(ref _SumCount, value);
            }
        }


        /// <summary>
        /// 
        /// </summary>
        private double _TableHight;
        public double TableHight
        {
            get => _TableHight;
            set => SetProperty(ref _TableHight, value);
        }


        /// <summary>
        /// 
        /// </summary>
        private double _RowHight;
        public double RowHight
        {
            get => _RowHight;
            set => SetProperty(ref _RowHight, value);
        }


    }
}
